﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Text.RegularExpressions
{
  public static class MatchCollectionExtension
  {
    public static string[] ToResultArray(this MatchCollection mc, int group)
    {
      string[] ret = new string[mc.Count];
      int index = 0;
      foreach (Match m in mc)
        ret[index++] = m.Groups[group].Value;

      return ret;
    }
  }
}
